import {createSlice} from '@reduxjs/toolkit'
const countSlice = createSlice({
    //    作为type的前缀
    name: "counter",
    // 初始值
    initialState: {
        count: 0,
        movieList: []
    },
    reducers: {
        increatment(prev, action) {
            console.log(prev, action);
            prev.count += action.payload
        },
        decreatment(prev, action) {
            prev.count -= action.payload
        },

    }

})

export const {increatment,decreatment} = countSlice.actions
export default countSlice.reducer